package Demo2;

public class Demo8 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1=new Thread(()->{
            for (int i = 0; i <100 ; i++) {
                System.out.println("hello thread");
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }


        });
        System.out.println(t1.isAlive());
t1.start();

Thread.sleep(14000);
        System.out.println(t1.isAlive());
    }
}
